Optimizing the Steering of Driverless Personal Mobility Pods with a Novel Differential Harris Hawks Optimization Algorithm (DHHO) and Encoder Modeling

This paper aims to improve the steering performance of the Ackermann personal mobility scooter based on a new meta-heuristic optimization algorithm named Differential Harris Hawks Optimization (DHHO) and the modeling of the steering encoder. The steering response in the Ackermann mechanism is crucial for automated driving systems (ADS), especially in localization and path-planning phases. Various methods presented in the literature are used to control the steering, and meta-heuristic optimization algorithms have achieved prominent results. Harris Hawks optimization (HHO) algorithm is a recent algorithm that outperforms state-of-the-art algorithms in various optimization applications. However, it has yet to be applied to the steering control application. The research in this paper was conducted in three stages. First, practical experiments were performed on the steering encoder sensor that measures the steering angle of the Landlex mobility scooter, and supervised learning was applied to model the results obtained for the steering control. Second, the DHHO algorithm is proposed by introducing mutation between hawks in the exploration phase instead of the Hawks perch technique, improving population diversity and reducing premature convergence. The simulation results on CEC2021 benchmark functions showed that the DHHO algorithm outperforms the HHO, PSO, BAS, and CMAES algorithms. The mean error of the DHHO is improved with a confidence level of 99.8047% and 91.6016% in the 10-dimension and 20-dimension problems, respectively, compared with the original HHO. Third, DHHO is implemented for interactive real-time PID tuning to control the steering of the Ackermann scooter. The practical transient response results showed that the settling time is improved by 89.31% compared to the original response with no overshoot and steady-state error, proving the superior performance of the DHHO algorithm compared to the traditional control methods.


Introduction
The steering mechanism has multiple types based on the number of wheels and the overall layout of the vehicle.Two-wheel differential drive with passive cater(s) typically consists of two powered wheels with one or more passive cater(s) for stability [1].The two-wheel differential drive with one powered steering caster is similar to the previous one, except there is a powered steering caster for direction control [2].Four-wheel differential drive (skid steering) is a mechanism where varying wheel speeds enable steering.The car has four motors connected to the four wheels, enabling speed control on each wheel [3].Rear-wheel forklift steering is a mechanism where the steering is carried out primarily via the rear wheels, and is widely used in warehouse forklifts [4].
An all-wheel steering mechanism is a mechanism where all wheels can independently steer, allowing a high degree of mobility and maneuvering [5].Rocker Bogie mechanism is a system where the chassis's pitch is averaged and altered to maintain weight distribution and wheel-ground contact [6].Omni-wheel (Mecanum) steering utilizes omni-wheels for multi-direction movements, enabling movement in diagonal directions [7].Crab steering is a four-wheel drive mechanism that allows horizontal translation, and all wheels can turn in four-point turns [8].
Ackerman's steering mechanism is the most traditional car steering mechanism used in commercial cars.It has fixed rear wheels and a front steering wheel to control the direction.It is a straightforward control geometry with non-slipping wheel turns, but it requires accurate steering mapping to determine the car location precisely [9].This paper will study the Ackermann mechanism for a mobility scooter.
The mobility scooter prototype is based on the Ackermann mechanism, where the car's direction and the power steering mechanism are related.The Ackermann steering architecture is a conventional steering system used in most commercial vehicles and trucks.Its main principle is based on the fact that the inside wheel travels a shorter radius than the outside wheel.The Ackermann mechanism is designed to turn the inner wheel at a greater angle than the outer wheel, leading to the inner wheel traveling a shorter radius than the outer one.In practice, when the steering wheel, the steering motor, rotates, it translates the rotation angle through the tie rods used to pull or push the steering arms, causing the wheels to turn at different angles [10].
Ackermann steering is preferred in most passenger cars due to its simplicity and efficiency.It has fewer control parameters because it only controls the steering motor fixed on the steering mechanism rather than controlling four different motor speeds.However, it provides less maneuverability in too-tight turns compared to the four-wheel differential drives.Therefore, Ackermann is preferred in passenger vehicles because the city streets are designed to fit large cars with acceptable turns [11].
The steering control is crucial in autonomous driving systems (ADS) because it helps to determine the car's current location in the localization phase and is used in the path planning stage in the ADS.The ADS vehicles are electric-based vehicles that witnessed significant advancements in the last decade owing to their low-carbon benefits and high energy efficiency compared to traditional vehicles [12].Therefore, the overall performance of the whole ADS in the Ackermann mechanisms relies heavily on the steering angle accuracy [13].The steering control process involves implementing two layers: hardware represented in the controller, software that includes the control algorithm, and the firmware of the whole system.
The controller is the brain of the robot, and it is responsible for controlling all the operations of any autonomous system.The microcontroller is a computer on a single chip, sometimes named a microcomputer.There are various types of microcontrollers produced by different vendors, such as Programmable logic controllers (PLCs) for industrial applications [14], PIC microcontrollers from Microchip Technology (Chandler, AZ, USA), ARM microcontrollers from ARM Holdings (Cambridge, UK) [15], myRIO from National Instrument (Austin, TX, USA) [16], AVR from Atmel (now part of Microchip Technology, Chandler, AZ, USA) which is the core of the Arduinos [17], Jetson from NVIDIA (Santa Clara, CA, USA) [18], and Raspberry Pi from the Raspberry Pi Foundation (Cambridge, UK) [19].
The control algorithm represents the methods to minimize errors between the desired and actual steering angles in automatic closed-loop control systems.These control algorithms can be implemented as code compiled on the controller.There are various control algorithms: classic PID controllers and Intelligent controllers.Classic PID controllers are used worldwide in more than 95% of control system applications.It is simple, easy to implement, and highly effective [20].
PID controllers are based on three components: proportional term, integral term, and derivative time.The main disadvantage of the PID controller is the time-consuming parameter tuning process.Multiple methods are used for parameter tuning, such as the traditional methods, Ziegler-Nichols (ZN), and intelligent meta-heuristic optimization algorithms, such as the PSO algorithm.
Multiple meta-heuristic optimization algorithms, such as PSO, CMAES, and BAS algorithms, have been used for PID tuning in steering control.One of the most recent algorithms is the Harris Hawks optimization (HHO) algorithm, introduced in 2019.This algorithm proved its efficiency in multiple applications, including PID tuning, which outperforms state-of-the-art algorithms [21].However, to the author's best knowledge, the HHO algorithm has yet to be applied to the PID tuning for steering control.Despite the promising results of the HHO algorithm, the HHO lacks diversity in its population, which requires improvements [22].Therefore, the proposed algorithm is based on a meta-heuristic optimization algorithm for parameter tuning.
The main contributions of this paper are summarized as follows: • A novel variant called the Differential Harris Hawks Optimization (DHHO) algorithm is introduced to improve the premature convergence and the population diversity of the traditional HHO algorithm.

•
Practical experiments are conducted on the steering encoder sensor in the power steering mechanism, and supervised learning is applied to deduce the steering model of the sensor necessary for the steering control.• Practical implementation of the closed-loop steering control system on the Landlex Broadway RS (Landlex, Manchester, UK) personal mobility scooter.

•
The proposed DHHO algorithm is applied and validated for real-time PID tuning for the steering control of the scooter.

•
Simulation results: The DHHO algorithm improved the mean error by 99.8047% and 91.6016% in the 10-dimension and 20-dimension of the CEC2021 benchmark functions compared with the traditional HHO algorithm.

•
Practical results: The transient response results of the steering control showed that the settling time is improved by 89.31% compared with the original response with no overshoot and settling time.
The rest of the paper is organized as follows: Section 2 discusses the previous research performed on the scooter and its drawbacks.The state-of-the-art algorithms used for PID tuning and the standard HHO algorithm are also discussed.Section 3 introduces the proposed DHHO optimization algorithm.Section 4 presents the diversity analysis between the DHHO and the HHO algorithm as a proof of concept.Section 5 illustrates the validation and the simulation results of the proposed DHHO and the state-of-the-art algorithms on CEC2020/2021 benchmark functions.Section 6 presents the hardware contributions to the scooter, including the system's hardware modifications and practical experiments on the steering mechanism to draw the relationships needed for the steering control.Section 7 explains the practical application of the proposed DHHO algorithm to the real-time PID tuning in the steering control and the transient response results.Section 8 presents an overall discussion of the results for all the experiments conducted in this paper.Finally, the summary and directions for future work are presented in Section 9.

Related Work
The related work is explained in three segments: First, the Landlex personal mobility scooter is described, and modifications are made to it in the related work.Second, the state-of-the-art PID tuning algorithms in the steering control are discussed.Finally, the standard HHO algorithm is explained in detail as a preliminary step before explaining the methodology.

Landlex Broadway RS Personal Mobility Scooter
Commercial mobility scooters, used by individuals with limited mobility, are excellent examples of vehicles deploying the Ackermann steering mechanism.This mechanism is essential in these scooters to guarantee smooth and secure navigation.The typical mobility scooter used in this study is the Landlex Broadway RS, the four-wheel model S400xR-RS [23].It implements the Ackermann steering system using a straightforward linkage setup connected to the front wheels.
Philip et al. proposed a modified version of the Landlex Broadway RS Scooter.The scooter was modified to make it driverless by adding an electric-powered steering motor from a Vauxhall Corsa C (Vauxhall Motors, Luton, UK) and replacing the manual controller with an NI myRio controller to control the scooter [24].The scooter layout is shown in Figure 1.The scooter in [24] has a set of drawbacks, and multiple points need to be improved for better performance.First, the power steering motor used to control the steering angle is a geared DC motor, in which the performance of the steering response is strongly related to the PWM signal applied to the DC motor.Applying a high PWM signal for a slight steering angle will make the steering mechanisms jerky and cause sudden turns, which is undesirable.Therefore, adaptive steering control is required to handle this problem.
Second, the angular throttle potentiometer (encoder) is not calibrated, and there is no relationship between the steering motor angle and the encoder angle.Therefore, the encoder signal will be meaningless when it is fed back to the controller because the corresponding angle of the steering motor is unknown, leading to inaccurate steering control; it acts as an open-loop controller.Therefore, the relationship between the potentiometer reading and the steering motor angle must be obtained.
In addition, the Ackermann mechanism in the Landlex Broadway RS Scooter is different from the exact standard Ackerman.Hence, the mechanism's geometry does not accurately represent the steering angle for the front wheels.Moreover, mounting the power steering motor adds unmeasurable left and right angle variations.This problem will lead to wrong steering and wrong destination for the path planning.Therefore, the relationship between the motor angle and the left and the right wheel steering angles must be obtained.
Furthermore, the myRio-1900 controller (National Instrument, Austin, TX, USA) has a powerful processor, but its operating system is NI Linux Real-time (part of LabVIEW 2021), which is not a pure Linux operating system [25].Installing an ROS-based system on NI Linux is not straightforward and requires dependencies unavailable in the NI feeds of the myRio-1900 [26].Therefore, the myRio-1900 controller must be replaced by a Linux-based controller, which supports ROS dependencies.Raspberry Pi controller is a suitable choice for the proposed system.

PID Tuning Algorithms
A PID controller controls the steering angle of the mobility scooter.It requires parameter tuning to find the relevant gain values that are hardware-dependent.Traditional techniques, such as manual tuning and Ziegler-Nichols (ZN) techniques, can be used but do not provide accurate results.However, they can be used to give an appropriate starting point [27].Meta-heuristic optimization algorithms are widely used to solve various optimization problems.Recently, they are applied to the PID controller to obtain the parameter values of the PID controller.
Zhou et al. introduced a PID controller to control the steering of an automated guided vehicle (AVG) optimized by particle swarm optimization (PSO) algorithm, which significantly improved the performance [28].Gao et al. proposed a PID controller tuned based on the PSO algorithm to control the vehicle's speed, which improved convergence speed [29].Maki et al. proposed a PD controller tuned by the Covariance Matrix Adaption Evolution Strategy (CMA-ES) algorithm to improve the steering performance, which improved the performance compared to the traditional methods [30].
Zhang et al. introduced a PID controller to control the steering angle of an Ackermanbased Automated Guided vehicle based on the Beetle Antennae Search (BAS) algorithm, outperforming the traditional PID controller [31].Moshayedi et al. applied different algorithms for the PID tuning to control AGV's steering, including Ziegler-Nichols (ZN), PSO algorithm, and BAS algorithms.Results of the ZN, PSO, and BAS algorithms provided error values close to each other.The fastest algorithm was the BAS, and the best performance was the PSO algorithm [32].He et al. proposed a PI controller for steering control in self-driving vehicles (especially trucks) based on the PSO algorithm, which results in stable final error [33].Zhang et al. proposed a PSO-based PID controller to control the steering of an unmanned ground vehicle, which provided a feasible performance [34].
One of the most recent meta-heuristic algorithms is the Harris Hawks Optimization (HHO) algorithm.This algorithm was first introduced by Heidari et al. in 2019, and it outperformed robust algorithms such as PSO, GA, GWO, FA, DE, and more [35].This algorithm has been applied to various applications theoretically and practically [36].HHO has been used for the PID parameter tuning problem for many applications, such as speed control and multiple electrical applications.Ekinci et al. proposed an HHO-based PID controller to improve the performance and stability of the automatic voltage regulator (AVR) system, outperforming the BBO algorithm [37].Elkady et al. proposed an HHO-PI controller to improve the transient response of the dynamic voltage restorer (DVR) system, outperforming the PSO and WOA algorithms [38].
Ekinci et al. proposed another HHO-PID controller for regulating the speed of a DC motor, outperforming ASO, GWO, and SCA algorithms [39].Izci et al. proposed a PID controller optimized by the HHO to control the aircraft pitch angle, outperforming SSA and ASO algorithms [40].Munagala et al. presented an HHO-PID controller to control the speed of a DC motor, outperforming GWO and SFS algorithms [41].Sahu et al. proposed an HHO-based PID controller to control a solar-thermal system's load frequency (LFC), outperforming the traditional controller [42].Karnavas et al. presented an HHO-PID controller to control the frequency of power generation systems, outperforming the PSO-based controller [43].
Izci et al. introduced an HHO-based PID controller to control the terminal voltage in the automatic voltage regulator (AVR) system, outperforming the traditional PID controller in terms of transient response [44].Rani et al. proposed an HHO-PI controller to control the harmonics on the grid side of the voltage source converter (VSC), which was successfully verified and compared with the other converters [45].Aldin et al. presented an HHO-PI controller to control the speed of the permanent magnet synchronous wind generator (PMSWG) system, outperforming the traditional PID and adaptive fuzzy logic (AFLC) controllers [46].
While various optimization algorithms have been successfully applied to PID tuning for steering control, each has its limitations.The CMA-ES algorithm can suffer from high computational complexity, making it less efficient for real-time applications than the PSO, BAS, and HHO algorithms.The PSO algorithm is effective in PID tuning due to its simplicity and low time complexity.However, PSO may converge prematurely to local optima because it lacks separate exploration and exploitation phases and is parameterdependent, leading to an imbalance between local search (exploitation) and global search (exploration) [47].The BAS algorithm is considered the fastest compared to PSO, HHO, and CMA-ES, but it lacks robustness in diverse optimization landscapes, resulting in lowerquality solutions [32].Although the HHO algorithm has shown success in PID tuning for various applications, it has not yet been applied to the PID tuning of steering control applications.The primary limitation of the original HHO algorithm is its low population diversity, which can result in the exclusion of valuable search spaces [22].
The proposed Differential Harris Hawks Optimization (DHHO) algorithm addresses these issues by introducing a Hawks mutation operator in the exploration phase, enhancing diversity and global search capabilities and thereby improving performance in complex optimization scenarios such as steering control.The DHHO algorithm is distinguished by having a separate stage for exploration and a separate stage for exploitation, both controlled by a dynamic parameter called the escaping energy, similar to HHO.This adaptive parameter balances the two phases and overcomes the single-stage and parameterdependency issues in the PSO algorithm.The DHHO algorithm is also less complex than the CMA-ES algorithm, resulting in lower computational time.The enhanced diversity is expected to reduce the chances of getting trapped in local minima and outperform the original HHO, PSO, BAS, and CMA-ES algorithms, which will be proved in the diversity analysis and benchmark testing.

Standard Harris Hawks Optimization (HHO) Algorithm
The cooperative hunting behavior of the Harris hawks in nature inspires the HHO algorithm.The population's candidate solutions are called Hawks, predators that hunt for prey.The prey called the rabbit in the HHO algorithm represents the best solution for the population.The objective is to find the best prey (rabbit) to be haunted by the hawks.During the iterations, the hawks evolved via the exploration and exploitation process to find the rabbit.This algorithm mathematically relies on three main components: the escaping energy, the exploitation based on the besiege and leapfrog technique, and the exploration based on the Harris' hawks perch method.The algorithm is based on the dynamic transition between exploration and exploitation based on the escaping energy of the prey (the solution).This dynamic behavior between global and local search provides the algorithm with powerful search capability [35].
The first component is the escaping energy (E), which is vital in switching between the exploration and exportation phases.Therefore, it decides how the population's solutions are updated.The high energy at the beginning switches the exploration phase, which leads to tremendous and random changes in the hawk.This exploration process represents the search for prey.As the algorithm iteration increases, the energy becomes low, which switches the exploitation phase, which means the hawks are updated to move closer to the best solution (the rabbit).This exploitation process mimics the procedure of attacking the prey.The escaping energy E is calculated from Equation (1), where E0 is a randomly generated factor to introduce variability in the escaping energy, and E1 is a decreasing energy factor that is inversely proportional to the ratio between the current iteration t and the maximum iterations T. E represents the decreasing energy of the prey as it tries to escape from the hawks.
The exploration phase in the HHO algorithm represents the hawks' searching the environments to locate the prey.The main objective of this process is to explore most of the search space.The exploration phase aims to give the population high diversity to avoid falling into a local minimum.In the HHO, the exploration is based on random movements by the hawks based on the positions of other hawks in the population or randomly selected locations, as defined in Equation (2).A random number q between 0 and 1 is generated; if it is less than 0.5, the new hawk's position X new is generated based on the current hawk's position X, and a randomly selected hawk X rand .If q is greater than or equal to 0.5, X new is generated based on the mean positions of the hawks X mean , and the rabbit R that represents the best solution.The lower and upper bounds are U and L, and r 3 , r 4 , r 5 , r 6 are random numbers between 0 and 1.
The exploitation process in the HHO algorithm represents a strategic approach by the hawks to catch the spotted prey.This process is mathematically described by a set of cases as shown in Equation (3).This process involves using the best current prey (rabbit) R to guide the search.It consists of four techniques based on the rabbit energy E and the jumping strength of the rabbit J, where J = 2 • (1 − rand()).The four techniques are the soft besiege (deceptive approach), the hard besiege (direct attack), and the leapfrog movements in two phases.Where r, r 1 , and r 2 are random numbers between 0 and 1, and Levy() is a function introducing random walks (called Levy flights) for diversification.
The algorithm starts by initializing a random population of candidate solutions called Hawks.Second, the algorithm defines the best solution in the population as a rabbit R based on the fitness function.Next, the algorithm starts the main loop and continues until it reaches the maximum number of iterations.Third, the energy E is updated from Equation (1); if the energy is high, then the exploration equation Equation ( 2) is applied to update the hawk.If the energy is low, then the exploitation equation Equation ( 3) is applied to update the hawk.Fourth, the fitness of the updated hawk is calculated, and the rabbit is updated if the new hawk is more fit than the rabbit.At the end of the algorithm, the best solution is the rabbit R. The pseudocode of the original HHO algorithm is presented in the Supplementary Materials File (Algorithm S1).

The Proposed Differential Harris Hawks Optimization (DHHO) Algorithm
The main drawback of the original HHO algorithm is its susceptibility to becoming trapped into the local minimum due to the low population diversity, leading to missing some valuable search spaces [22].This low diversity leads to premature convergence of the search process [48].The structure of the HHO algorithm allows the hybridization of different exploration strategies that can improve the diversity of the population and reduce the possibility of getting trapped in a local minimum [21].
The proposed DHHO algorithm is based on introducing reproduction and replication between hawks to generate a diverse population.The main objective of the algorithm is to improve the diversity of the Hawks' population during the exploration phase.The DHHO algorithm enhances the exploration capability by deploying the mutation operator DE/rand/1 as an exploration method instead of Harris' Hawks perch technique in Equation (2).
The DHHO algorithm starts by initializing a random population P consisting of N hawks; each hawk X i represents a candidate solution for the optimization problem.The hawk consists of D dimensions, where X i,j is the j-th dimension of the i-th hawk.The population set P can be formulated as in Equation (4).
The fitness function f (X) is used to evaluate the quality of the solution X (hawk) for the optimization problem.The fitness function mainly represents an error function, so a low fineness value means low error, which shows a high-quality solution.On the other hand, a high fitness value means a low-quality solution.The global best represents the solution with the minimum fitness value, which represents the final solution of the optimization problem, and it is called the Rabbit R. At the beginning of the algorithm, the quality of the solutions in the initial population is low due to the random initialization.As the algorithm proceeds, the quality of the solutions improves.
The loop of the algorithm starts by iterating each hawk X i in the population X.First, the escaping energy E is calculated to the current hawk X i using Equation (1), as in the standard HHO algorithm.The escaping energy E switches between two primary phases: exploration and exploitation.If E is low (less than 1), the hawk X i undergoes the exploitation phase using the third and fourth cases in Equation ( 3), as in the standard HHO algorithm.
On the other hand, if E is high (more than 1), the hawk X i undergoes the exploration phase, which is modified in the DHHO algorithm; Equation (2) in the standard HHO algorithm is replaced by the mutation operator DE/rand/1.In this operator, the position of the mutant hawk V g i is randomly generated based on three randomly selected hawks from the population X g r1 , X g r2 , and X g r3 , as in Equation ( 5).The scaling mutation factor F is set to 0.5.The mutant hawk V g i represents a new hawk with different genes generated by the mixture of three random hawks, indicating a diverse hawk.
A binomial (uniform) crossover operator is applied between the mutant hawk V g i and the current hawk X g i according to Equation ( 6).The mutant hawk and the current hawk represent the parents of the newly generated child hawk U g i .Each dimension of the child hawk U g i,j selected between the two corresponding parents' dimensions based on a crossover probability CR, which is set to 0.5 (50%) to give an equal chance for the two parents.The child hawk U g i is generated based on the replication between two parents, and the child carries 50% of the genes from the first parent X g i (the current hawk) and 50% from the other parent V g i (the mutant hawk).Finally, the new hawk X g+1 i is selected between the child hawk U g i and the current hawk X g i based on the survival of the fittest principle, as in Equation ( 7).The fitness of child hawk f (U g i ) is calculated and is compared with the fitness of the current hawk f (X g i ).
If the child hawk has better fitness than the current hawk, the child hawk U g i will pass to the next generation.On the other hand, if the current hawk is better than the child hawk, the parent (current) hawk X g i will pass to the next generation.
Algorithm 1 shows the pseudocode of the steps of the DHHO algorithm.The algorithm starts by initializing a random population of candidate solutions called Hawks.Second, the algorithm defines the best solution in the population as a rabbit R based on the fitness function.
Next, the algorithm starts the main loop and continues until it reaches the maximum number of iterations.Third, the energy E is updated from Equation (1), as this energy determines how the hawk will be updated.If the energy is high, then the modified exploration equation Equation ( 5) is applied to update the hawk.Next, the crossover and selection operator are applied using Equation (6) and Equation (7), respectively.These equations ensure a higher diversity of the population than the one from the traditional HHO exploration in Equation (2).
If the energy is low, then the third and fourth cases of the exploitation equation Equation ( 3) is applied to update the hawk.Fourth, the fitness of the updated hawk is calculated, and the rabbit is updated if the new hawk is more fit than the rabbit.At the end of the algorithm, the best solution is the rabbit R. A flowchart of the DHHO algorithm is presented in the Supplementary Materials File (Figure S1).
Algorithm 1 Differential Harris Hawks Optimization (DHHO) Algorithm 1: Initialize the population X i , i = 1, 2, . . ., N 2: Evaluate the fitness of each hawk 3: Initialize the best solution found so far as the rabbit's location R 4: for t = 1 to T do ▷ T is the maximum number of iterations 5: for each hawk i do 6: Update energy E of the rabbit from Equation (1) 7: if Rabbit's energy is high then ▷ Exploration phase 8: Generate mutant hawks using Equation ( 5).

9:
Apply crossover between the current and the mutant hawks using Equation ( 6).Apply selection method to get the new hawk's position using Equation (7).Record the best solution found so far 20: end for 21: return Best solution found R

Exploration and Diversity Analysis (HHO vs. DHHO) as a Proof of Concept
The main objective of the DHHO algorithm is to improve the diversity and exploration capability of the original HHO algorithm.This section conducts a fair experiment between the HHO and DHHO algorithms to evaluate both populations' diversity.The exploration method of the DHHO algorithm involves the mutation operator as in Equation (5).At the same time, the exploration technique of the HHO algorithm is based on perching and random tall trees as in Equation ( 2).The assumed hypothesis that the DHHO has more diversity than the HHO will be proved through statistical analysis of multiple dimensions search spaces.First, both algorithms started with the same initial random population of 30 individuals.
The experiment is performed on multiple dimensions, varying between 10 and 100, with a step of 10.The lower and upper ranges are assumed to be between −10 and 10 for all dimensions of both algorithms.The termination condition is set to a maximum number of iterations of 300.Due to the existence of some random parameters, each experiment for each dimension was performed for 50 individual runs.Then, the average performance is calculated for all the runs.
The experiment only focuses on measuring the average variance and the standard deviation in the dimensions of each individual in the population throughout the iterations and runs.This method stresses the population's diversity rather than the algorithm's convergence.High variance means high diversity in the population, resulting in a diverse population with less possibility of falling into a local minimum, and this is the main objective of the exploration process.
The average variance of all 50 runs among all the individuals has been stored and monitored over the iteration progress.Figure 2a displays the mean-variance and the mean, standard deviation for the two exploration methods for all the dimensions.The detailed diversity plots for each dimension from 10 to 100 are presented in the Supplementary Materials File (Figure S2).
Table 1 shows the results for each exploration method for all the dimensions, where the first column represents the size of the dimensions, the second column is the algorithm name, the third column in the average peak variance for all the individuals in the population over the 50 runs, and the fourth column is the standard deviation for them.
Analyzing the variance and the standard deviation (SD), it is evident that the DHHO algorithm exhibits a higher variance and SD than the HHO algorithm for all the dimensions.This finding suggests that the DHHO can explore a broader search space range, indicating greater population diversity during the exploration phase.As the dimensions increase, both algorithms' variance and SD increase, but the increase rate of DHHO is much more than the HHO, as seen in Figure 2b.
The higher diversity of the exploration method proposed in the DHHO shows its ability to cover a broader range of the search space.It is less likely to become trapped in local optima and reduces the risk of premature convergence.It also has better chances of finding a global optimum while exploring more solutions.The Wilcoxon signed-rank test is conducted for both the variance and the SD across different dimension sizes to prove the significance of the results.Regarding the variance comparison, the p-value is 0.001953125, less than the alpha level of 0.05, indicating the significance of the DHHO exploration compared to the HHO exploration.Concerning the SD metric, the p-value also equals 0.001953125, which is less than 0.05, indicating the significant advantage of the DHHO exploration capability over the HHO.
In summary, based on the statistical analysis and the observed results, the DHHO algorithm's exploration demonstrates a superior ability to explore more search spaces compared to the HHO algorithm.Therefore, replacing the HHO exploration technique with the mutation operator in the DHHO algorithm leads to a more robust algorithm for solving complex optimization algorithms.

Benchmark Testing on CEC2020/2021
This section evaluates the proposed DHHO algorithm against the meta-heuristic optimization algorithm recently used in the literature for PID tuning, as mentioned in the literature review.The DHHO algorithm is compared with the Particle swarm optimization (PSO), Covariance matrix adaptation evolution strategy (CMA-ES), Beetle Antennae Search (BAS), and original Harris Hawks Optimization (HHO) algorithms.All these algorithms will be validated for the ten benchmark functions of CEC2020/2021 for 10 and 20 dimensions.

Parameters Setting
Five algorithms have been compared: PSO, CMA-ES, BAS, HHO, and the proposed DHHO.The parameters setting for the algorithms are shown in Table 2.The population size is set to 30 for all the algorithms.All algorithms are tested on ten functions of CEC2020 [49], which have the same test suit for CEC2021 [50].Each algorithm runs for 30 independent runs for the 10-dimension and the 20-dimension cases.The termination condition is set to a maximum function evaluation (MaxFES) of 200,000 for the 10-dimension case and 500,000 for the 20-dimension case.
The fitness function is set as the error function , where F i (X) is the fitness of the best-obtained solution by the algorithm for the i-th function, and F i (X * ) is the best-known solution for the i-th problem, as in [49].The tolerance in error is set to 1.0E-08 as a termination condition.The search range for all the dimensions for all problems lies in the range [−100,100].

Results of the Benchmark Testing
The best error for each algorithm is collected in all 30 runs.The best, worst, median, mean, and standard deviation (SD) metrics are then calculated for each algorithm in all the runs.These results are presented in Table 3 for both the 10-dimension and the 20-dimension cases.The first column is the function label, the second column is the algorithm name, columns 3-7 are the error metrics for the 10-dimension case, and the last five are the error metrics for the 20-dimension case.
The results in that table are visualized using the box and violin plots.These plots show the distribution of the results in the 30 runs.In the box plots, small and compact boxes indicate the repeatability of the results.A red line in the middle of the box indicates the mean of the results.Violin plots are similar to the box plots, but density plots are included.The black line in the violin plot represents the mean, and the dashed red line represents the median.Figure 3 show the violin plots for the 10-dim and the 20-dim functions.The proposed DHHO algorithm demonstrates repeatable and compact distribution of the results in most of the functions.The median and the mean results in the violin plots match the result in Table 3.On the other hand, the BAS algorithm shows the least efficient distribution compared to the other algorithms.A compact violin means more repeatability in violin plots, and a lower violin means less error.The DHHO shows the lowest and the most compact violin plots compared with the other algorithms, especially the original HHO algorithm.Visual analysis is not enough to evaluate the performance of the algorithm.Therefore, statistical analysis is performed in the following section.The box plots are similar to the violin plots but are less informative.These box plots are presented in the Supplementary Materials File (Figures S3 and S4).

Statistical Analysis of the Results
Group comparison is conducted using the Friedman test to obtain the ranking of the best-performing algorithms.Then, paired comparisons are held between the proposed DHHO algorithm and the other algorithms using the sign test and the Wilcoxon signed rank tests to evaluate the one-to-one performance of the algorithm.The statistical analysis is conducted on the mean and the median error results for the 10-dim and the 20-dim functions.The level of significance α is assumed to be 0.1.If the p-value of any test is less than the significance level, this indicates significant results.Table 4 shows the statistical analysis results in all the statistical tests used in the validation process.
The results of the Friedman test are shown in columns 4-7 in Table 4.The fourth column represents the summation of the ranks obtained by each algorithm for each function.The best algorithm with minimum error metric receives a rank value of 1, and the worst algorithm receives a rank value of 5.The fifth column is for the average rank among the ten functions for each dimension.The sixth column is the final order of the best algorithms from 1 to 5. The seventh column is the p-value of the Friedman test.
The p-value of the Friedman test in all cases is less than α, which indicates significant results.The proposed DHHO algorithm achieved first place for the mean and median metrics for the 10-Dim and the 20-Dim cases, outperforming all the other algorithms.The HHO, PSO, CMAES, and BAS algorithms achieved second, third, fourth, and fifth places, respectively.The ranking of the algorithms did not change with metrics or the dimensions.
Paired comparisons are held using the sign and Wilcoxon signed-rank tests.The DHHO is set as a reference to be compared to other algorithms.In the 10-dim case, the DHHO algorithm outperformed the HHO and the BAS algorithms in all 10 functions for the mean and median metrics.DHHO performs better than the PSO in eight functions, while PSO performs better in the other two, according to the mean and the median metrics.The DHHO algorithm has a better mean error than the CMES in nine functions and has a better median error in eight functions.

Table 4.
Statistical Analysis for all the algorithms for the 10-Dim and the 20-Dim benchmark functions.DHHO is used as a reference for all paired comparisons.In the Sign Test: '+' represents the number of functions where the DHHO is better, and '=' means draw.In the Wilcoxon: R+ > R− means the DHHO is better.In the Friedman test, a smaller mean rank means a better algorithm.The significance level α is between 0.05 and 0.1.The results are significant if p-value < α.

Dim Metric
Alg.The p-value in the HHO case is 0.001953, which means that the DHHO algorithm is better than the original HHO algorithm by 99.8047% in the 10-dim case.In all the comparisons of the 10-dim case, the p-value of the Wilcoxon test is less than α, indicating the significant performance of the DHHO algorithm.

Friedman
Regarding the 20-dim case, the DHHO algorithm has a better median error in 8, 9, 10, and 8 functions than the PSO, CMAES, BAS, and HHO algorithms.Similarly, the DHHO algorithm has a better mean error in 8, 9, 10, and 10 functions than the PSO, CMAES, BAS, and HHO algorithms.The p-value in the HHO comparison is 0.083984, which means that the DHHO is better than the original HHO algorithm by 91.6016% in the 20-dim case.In all comparisons, all the mean p-values of the Wilcoxon test are less than α, showing superior performance of the DHHO compared with the other algorithms.The statistical analysis proved the superiority of the proposed DHHO algorithm compared to the original HHO and the other algorithms.
Figure 4 shows the convergence graphs for the proposed DHHO algorithm compared with the original HHO algorithm for all the functions in the 10-dim and the 20-dim cases.These graphs represent the progress of the median error across the 30 runs, starting from the initial population until the algorithm terminates.The DHHO algorithm demonstrates better convergence than the HHO algorithm.The overall performance of the proposed DHHO algorithm outperforms the traditional HHO and the other algorithms in terms of diversity, convergence, and error.In the next step, the DHHO algorithm will be applied to the steering control problem as a practical validation for the algorithm.

Scooter Hardware Design and the Proposed Steering Angle Mapping
This section sheds light on the contributions made to the scooter hardware.Moreover, the proposed mapping experiment for the steering angle and its results are discussed.

Overall View of the Enhanced Scooter Prototype
Figure 5 shows a hardware block diagram of the enhanced scooter prototype and how the components are connected to form the steering control system.The steering system's hardware consists of a set of hardware categories: two controllers, a steering encoder (potentiometer), and a power steering motor with a motor driver.The two controllers are the Raspberry Pi and the Arduino Mega.The rear motor and encoder can be added to the proposed system.However, the primary concern of this research is the steering control.The power steering motor used in the scooter is the Vauxhall Corsa C (Vauxhall Motors, Luton, UK) column [54,55], which is controlled using the CYTRON MD30C 30A motor driver (Cytron Tech, Bukit Mertajam, Malaysia) that handles and supplies power to the steering motor [56].A dedicated Strident lead acid battery of type GP12-34X (Strident Innovation, Swaffham, UK) with a capacity of 34AH supplies the steering motor through the motor driver [57].This battery provides power to the control circuit, including the Arduino.The typical minimum PWM that can rotate the motor is 16% duty cycle.If the PWM is set to less than 16% duty cycle, the motor spins in place and does not rotate.In the enhanced scooter, the electric power steering motor does not only assist the steering.However, it fully controls the steering for the driverless scooter.Therefore, the mechanical part that connects the steering wheel with the power steering column is removed.The steering motor takes complete control of the steering.
An angular potentiometer is attached at the bottom of the power steering columns to measure the motor's rotation angle.The potentiometer acts as a voltage divider where the voltage varies from 0 V to 5 V as the motor shaft rotates from left to right.The potentiometer output is an analog output that gives continuous voltage readings.This output is connected to an analog input in the Arduino, typically the A0 pin, that involves an analog-to-digital (ADC) conversion process inside the Arduino.The Arduino is supported by a 10-bit ADC module that maps the analog readings from 0 to 5 V are mapped to a digital reading from 0 to 1023 (2 10 − 1) with a resolution (sensitivity) around 4.88mV per unit (5 V/1024).
The primary controller, the Raspberry Pi Model 4B, is the primary controller of the whole ADS.It replaced the original myRio-1900 controller because myRio-1900 does not support ROS dependencies [58].The power is safely supplied to the Raspberry Pi using an X728 V2.3 UPS power circuit with two 18,650 lithium-ion batteries [59].An ultra-thin cooling fan is also used on the Raspberry Pi to maintain its temperature within the normal range.The ROS node for real-time parameter tuning is implemented, written in Python, and installed on Raspberry Pi.With the aid of the ROS system, the control node will run the proposed algorithm for real-time parameter tuning of the PID gains.It receives the current steering value from the Arduino and generates the updated real-time PID gains for the steering controller.
The secondary controller, the Arduino, receives the desired steering angle and the PID parameter values from the Raspberry Pi controller.The Arduino Sends a PWM signal to the front motor driver to make the power steering motor reach the desired angle.The power steering motor receives the PWM signal from the motor driver and starts rotating the wheels.While rotating, the front angular potentiometer, connected to the power steering motor, changes its value and returns it to the Arduino.The Arduino receives the front encoder signal and checks whether the desired steering angle is reached.This process is controlled via a proposed PID controller to ensure the steering angle is accurately reached.
The proposed structure allows the modularity of adding new software and hardware layers.The rear motor and encoder can be connected to the Arduino hardware layer.Advanced sensors such as LiDAR and cameras can be connected to the Raspberry Pi.Mapping and localization algorithms can be easily implemented as ROS nodes on the Raspberry Pi.Therefore, the proposed layout is beneficial in the autonomous driving system.

Steering Angle Mapping and Experiment Setup
The closed loop of the steering control system relies heavily on the relationship between the steering angle of the motor's shaft and the corresponding analog reading of the encoder.The relationship between the Arduino's digital reading and the sensor's analog reading can be obtained using the resolution of the ADC.However, the relationship between the analog voltage reading from the sensor and the motor's rotation angle is unknown, and the relationship between the motor's angle and the steering angle of the left and the right wheels is also unknown.Therefore, mapping experiments have been intensely conducted and analyzed to obtain these relationships.Moreover, the operating range of the seeing angle and the maximum and minimum steering angles are also undefined.Therefore, these angles should be practically measured and mapped to find these relationships.
In total, five parameters need to be measured in this experiment: the angular potentiometer voltage, the digital reading in the Arduino, the motor rotation angle, the left wheel steering angle, and the right wheel steering angle.This section discusses the setup and the tools used to measure all these five parameters accurately.
Regarding the voltage reading of the angular potentiometer, a multimeter is connected to the sensor's output to measure the signal's voltage.At the same time, the output of the potentiometer is connected to an Arduino analog input A0 to read the digital value of the sensor.The Arduino has a 10-bit analog-to-digital converter, so the output digital readings range from 0 to 1023 [60].
The most challenging part is measuring the three angles: the motor rotation angle, the left wheel steering angle, and the right wheel steering angle.This experiment aims to capture accurate photos of the angles and measure them by analyzing the digital image.It is performed as a set of steps to build a robust measurement system.
In the first step, three fixed zip ties were used for each angle to reference each angle.The zip tie for each angle is attached so that it points in the forward direction of the car.The zip ties are connected to three fixed rods on the scooter chassis; each rod is in line with the axis of rotation of each angle.A spirit-level tool has been used to ensure the fixed zip tie alignment, such that the fixed zip tie is perfectly parallel to the car's chassis and points in the forward direction [61].
In the second step, a movable zip tie is attached to a movable rod in the chassis such that it rotates with the motor.Three rods have been chosen: a rod lies on the axis of rotation of the motor, a rod on the axis of rotation of the left wheel, and a rod on the axis of rotation of the right wheel.The movable zip tie is attached in a poison so that it intersects with the fixed zip tie at the axis of rotation of each angle.A cross-laser lever has been used to align the intersection point between the fixed and movable zip ties with the axis of rotation.
The cross-laser level projects two perpendicular intersecting laser lines, making a 90°a ngle.The fixed zip tie is aligned to one of the laser lines [62].Then, the laser tool's position is adjusted such that the laser line's intersection point is in line with the axis of rotation of the motor.Finally, the movable zip tie is attached to align the second intersecting laser line.In this way, the intersection point between the fixed and the movable ties is aligned with the axis of rotation.The same steps are repeated for the left and right-wheel steering angles.
The third step is to fix three identical mobile phones at the bottom view for each angle.The cross-laser level tool has been used to align the camera lens of each phone with each angle.The phones are mounted on the scooter's test bench using 3M double-sided tape to avoid any movement.
The fourth step is to enable remote camera access for the three phones from a fourth phone.This remote access has been achieved by installing AirDriod personal mobile client on all three phones: A, B, and C. We log in to the same AirDriod account on all three phones [63].A fourth phone (Phone D) has been used as the controller of the three other phones (A, b, and C).The AirMirror app is installed on phone D, and we signed in to the same AirDroid account used on the three phones.After launching the AirMirror on phone D, we can see phones A, B, and C, and the camera for each phone can be triggered from phone D [64].This way, the three angles can be remotely captured to measure the angles from the generated images.

Mapping Experiment Results and Data Collection
The experiment was conducted by changing the steering angle from the maximum right (5 V) to the maximum left (0 V). Small steps (less than 0.2 V) have been performed to ensure multiple readings.The photo for each angle has been captured and stored in the memory.Moreover, the multimeter reading and the digital value in the Arduino have also been stored.An angle meter application has been used to measure the angle between the fixed and the movable zip ties for the three angles [65].
Figure 6 shows the photos captured for the three angles: the left steering angle for the left wheel, the motor rotation angle, and the right steering angle for the right wheel at specific encoder reading.The Supplementary Materials File presents more detailed captured photos (Figure S5).
The measured angles are written in the DMS (degrees, minutes, seconds) format.The DMS notation is used in applications that require a high level of precision.The path planning application requires high accuracy, so this notation has been used to get the most accurate angle readings.Equation ( 8) is used to convert the angles from the DMS format to decimal format [66].Table 5 shows all the measurements of the experiments.The first column represents the angular potentiometer readings obtained from the multimeter.It starts from 4.93 V to 1.01 V.The first finding in the readings is that the potentiometer range is from 4.93 V (at the maximum right) to 1.01 V (at the maximum left).The encoder readings from 0 V to 1.01 V always give the same steering angle because the chassis design hinders the wheels from going further than 1.01 V.The center position of the car is approximately at the encoder reading 3.13 V.The second column represents the digital readings obtained from the Arduino.The Arduino has a 10-bit ADC, so the values should vary from 0 to 1023.However, the mechanism limitations make the values range from 210 (at the maximum left) to 1017 (at the maximum right), corresponding to the voltage between 1.01 V and 4.93 V.
The third column represents the motor rotation angle readings, the fourth column represents the left steering angle for the left wheel, and the fifth column represents the right steering angle for the right wheel, all in DMS format.Some values are positive, and some are negative.The positive sign is assumed for the angles of the left side turn, while the negative sign is assumed for all the angles in the right side turns, where the reference axis is in the middle, pointing in the forward direction.
Columns from six to eight represent the three angles but in decimal format.Equation ( 8) is used to map between the DMS values in columns three to five to decimal values written in columns from six to eight.The motor rotation angle range is from −21.529°at the right to 23.582 °at the left.The left steering angle range is from −22.432°at the right to 31.430°at the left.The right steering angle range is from −26.833°on the right to 30.690°on the left.

Analysis of the Results of the Steering Angle Mapping
This section aims to find the relationship between the variables to be used in the kinematics layer in the proposed ROS system of the ADS.The required relationships are as follows: • The motor rotation angle as a function of the sensor digital reading.

•
The left steering angle as a function of the motor rotation angle.

•
The right steering angle as a function of the motor rotation angle.
The machine learning algorithm to find the relationship between two or more continuous variables is called regression.The training data used to find the relationship between the variables are in Table 5.The Ordinary Least Square method (OLS) has been applied to find the parameters of the training model.This method can be used for linear, polynomial, and multiple regression problems with independent variables.The OLS method aims to minimize the sum of the square differences between the observed dependent variable, as in Table 5, and the predicted values by the polynomial [67].
Three important performance metrics show the quality of the chosen model: the mean square error (MSE), the R-squared metric, and the Prob(F-statistic).The MSE metric represents the means square error; the less the error, the better the model.The tolerance of the acceptable MSE is assumed to be less than or equal to 0.3.The R-squared measures the proportion variance in the dependent variable that the independent variables in the model can explain.A high R-squared indicates more variance and a best-fit description of the relationship.The probability of the F-statistic metric is a direct measure of the significance level of the model or the right fit for the training data.If the Prob(F-statistic) is less than 0.1, this indicates a significant solid relationship of the model [68].

Motor Rotation Angle vs. Sensor Digital Reading
This section studies the relationship between the motor rotation angle as a dependent variable and the sensor digital reading as the independent variable.This relationship is needed in the feedback loop in the control system when the ADS system on the ROS sends the desired steering angle for the desired location of the scooter.The Arduino sends a signal to the front motor driver to enable the rotation of the steering motor.At this moment, the Arduino checks the digital reading from the steering motor encoder to check whether the desired steering angle of the motor is reached or not.Therefore, a relationship between the motor's rotation angle and the encoder's digital reading must be established.
The OLS algorithm has been applied to the training data of motor rotation angle in column six in Table 5 as a dependent variable, and the Arduino digital reading in column two in Table 5 as an independent variable.Multiple polynomials with different degrees have been tested from degree 2 to degree 10.Table 6 shows the algorithm's results.The first column shows the degree of the polynomial; the second column is the number of the model parameters; the third column represents the mean square error (MSE); the fourth column shows the R-squared metric; and the last column is the Prob(F-statistic) metric.The fourth-degree polynomial is the most suitable choice among all the models.The MSE of the fourth degree is significantly lower (0.2505) than that of all the other models, achieving a tolerance threshold of less than 0.3.The MSE has the minimum value at the fourth degree and starts increasing again when the polynomial degree increases, showing an over-fitting occurred for the high-degree polynomial, which is an undesirable response.
The R-squared of the fourth degree has the highest value (0.9988) and shows a very high variance in the relationship.The Prob(F-statistics) of the fourth degree has a very low value (less than 0.1) and shows a high significance level.The final relationship between the Arduino digital reading for the potentiometer sensor D enc and the motor rotation angle θ m is expressed in Equation ( 9) as a fourth-degree polynomial.The plot of the fourth-degree polynomial and the relationship between the degree of the polynomial and the MSE are presented in the Supplementary Materials File (Figure S6).θ m = 0.0 + 0.0459D enc − 0.0003D 2 enc + 0.0001D This section studies the relationship between the motor rotation angle as an independent variable and the left steering angle as the dependent variable.This relationship can help calculate the radius of turn of the left angle based on the steering motor angle, allowing the car position to be obtained after performing the steering.
The OLS algorithm was applied to the training data of motor rotation angle in column six in Table 5 as an independent variable, and the left steering angle in column seven in Table 5 as a dependent variable.Multiple polynomial degrees were tested from degree 1 to degree 10.Table 7 shows the algorithm's results.The seventh-degree polynomial is the most suitable choice among all the models.It offers a significantly lower MSE value (0.1315) than the lower degrees, achieving a tolerance threshold of less than 0.3.Despite the high degree of polynomial, it offers less MSE value, the error difference is insignificant, and the seventh degree provides less model complexity.
The R-squared of the seventh degree has the highest value (0.9996), indicating a good fit between the motor angle and the left steering angle.The Prob(F-statistics) of the 7th degree has a very low value (less than 0.1) and shows a high significance level.The final relationship between the left steering angle of the left wheel θ L and the motor rotation angle θ m is expressed in Equation ( 10) as a seventh-degree polynomial.The plot of the seventh-degree polynomial and the relationship between the degree of the polynomial and the MSE are presented in the Supplementary Materials File (Figure S7).

.3. Right Steering Angle vs. Motor Rotation Angle
Similarly, this section obtains the relationship between the motor rotation angle as an independent variable and the right steering as the dependent variable.The OLS algorithm has been applied to the training data of motor rotation angle in column six in Table 5 as an independent variable, and the right steering angle in column eight in Table 5 as a dependent variable.Multiple polynomial degrees have been tested from degree 1 to degree 10.Table 8 shows the algorithm's results.The eighth-degree polynomial is the most suitable choice among all the models.It offers a significantly lower MSE value (0.2286) than the lower degrees, achieving a tolerance threshold of less than 0.3.Although the higher-degree polynomials offer better MSE values, the error difference is insignificant, with the possibility of overfitting.Therefore, the eighth degree provides less model complexity and archives the trade-off between the error and the complexity.
The R-squared of the eighth degree has a very high value (0.9993), indicating a good fit between the motor angle and the right steering angle.The Prob(F-statistics) of the eighth degree has a very low value (less than 0.1) and shows a high significance level.The final relationship between the right steering angle of the right wheel θ R and the motor rotation angle θ m is expressed in Equation ( 11) as an eighth-degree polynomial.The plot of the eighth-degree polynomial and the relationship between the degree of the polynomial and the MSE are presented in the Supplementary Materials File (Figure S8).

Steering Control Application Using the Proposed DHHO Algorithm
This section discusses the application of the PID controller to steering control using the proposed DHHO algorithm.The transient response of the PID-DHHO controller for the steering control system is evaluated by comparing its performance to the response from traditional methods, such as manual tuning, the ZN technique, and the original HHO algorithm.

The Configuration of the Steering Control System
The steering control system is implemented as a closed-loop control system that minimizes error using a PID controller based on three actions: proportion, integral, and derivative.Figure 7 shows the block diagram of the closed-loop steering control system, which consists of four main blocks: the plant, actuator, sensor, and controller.
The plant of the steering control system is the power steering motor, which is a DC motor responsible for controlling the steering.The output of the steering motor is the steering angle, representing the controlled variable.The input signal of the steering motor is the motor input voltage as a PWM signal, representing the manipulated variable of the control system.The sensor in the steering control system is the angular potentiometer, which is attached to the steering motor shaft to measure the rotation angle.The signal of the potentiometer represents the actual angle, where it is compared to the desired angle to generate the error signal, e(t) as in Equation (12).The error signal represents the difference between the desired angle and the actual steering angle measured by the sensor.e(t) = Desired Steering Angle − Actual Steering Angle (12) The PID controller is implemented on the Arduino, receives the error signal, and generates the control signal.The control signal is equivalent to the manipulated signal (PWM signal), and it is generated based on three components: the proportional part, the integral part, and the derivative part.The proportional part achieves the concept of the proportional response to the error; if the error is high, the duty cycle will be high, and the motor moves faster; and if the error is small, the duty cycle of the PWM signal will be small, and the motor moves slower [69].
The integral part provides a final push to the control signal to eliminate the steadystate error.The proportional part cannot eliminate the steady-state error because the latter is too small to generate a control signal that can eliminate the final error.The derivative part predicts future errors and takes precautionary action to make the response faster toward the desired value.In other words, it improves the transient response.Equation (13) shows the relationship between all the PID components, the error signal, and the control signal [69].This equation is implemented in C language on the Arduino controller.
The actuator in this steering control system is the CYTRON MD30 motor driver, which receives the PWM control signal from the PID controller on the Arduino and generates the actuating signal that can control the steering motor's speed and direction.The direction of the motor is controlled by a straightforward digital signal with two states: logic-high to rotate in one direction and logic-low to rotate in the other direction.The speed of the motor is controlled using the PWM signal, which is obtained from the PID controller.The motor's speed and direction can be easily controlled via the PWM signal, but the question is how to control the steering angle.
The short answer to this question is the PWM combined with a feedback element.Although the PWM is mainly used to control the speed, the steering control indirectly relies on the PWM signal.The concept of controlling the angle is to set the PWM signal to a specific duty cycle to make the motor rotate in the direction of the desired angle with a particular speed.The closer the motor moves towards the desired angle, the less the duty cycle of the PWM signal.In other words, if the desired angle is further, the motor moves faster at the beginning, and if the motor is close to the desired angle, the motor moves slower towards the desired angle.
The gains of the PID controllers are dynamically tuned using the proposed DHHO algorithm, which is implemented as an ROS node on the Raspberry Pi controller.The PID tuning of the scooter's steering control is formulated as an optimization problem.Any optimization problem should define two main aspects: the solution format and the objective (fitness) function.The solution to the PID tuning problem is the three PID gains of the PID controller: K p , K i , and K d , representing a three-dimensional optimization problem.
The objective function of the problem can be represented as a weighted sum of the squared error and the maximum overshoot as in Equation (14).The squared error term represents the sum of the square of the error between the desired steering angle and the actual steering angle reading from the encoder over a specific time T. The square error is used instead of the sum of the errors to avoid negative-value errors and cancel positive errors during the summation process.The second term represents the maximum overshoot, the maximum difference between the desired value and the actual steering angle measured by the encoder over time T. It is required to keep the error and the maximum overshoot at the minimum value to obtain the best performance.The weights w 1 and w 2 are the weights for squared error and maximum overshoot metrics, set to 0. The main objective is to apply the proposed DHHO algorithm to minimize the total error of the objective function.The algorithm is applied to the steering control in real time, reading the final error from the Arduino and re-tuning the parameters until it reduces the error to the minimum value and improves the performance metrics.

Adaptive PID Tuning Using DHHO Algorithm
This section explains how the DHHO algorithm is applied to generate PID parameters for the steering control the system.The sequence of the execution is as follows: the desired angle is set inside the Arduino.Then, the error between the desired value and the encoder reading is calculated.With initial random PID gains, the PID controller equation is performed on the Arduino and generates the control signal based on the error.The control signal is in the form of a PWM signal that is sent to the steering motor via the motor driver.The encoder transmits the current angle reading, and the loop contains until the steering angle settles within a specific value after a period T.
The squared errors between the desired angle and the encoder readings are summed over the period T to obtain the SSE value.The maximum difference between the encoder reading and the desired steering angle is used to calculate the maximum overshoot.The final error is calculated based on Equation ( 14), and the total error (ET) value is sent from the Arduino to the Raspberry Pi.
On the Raspberry Pi, the proposed DHHO algorithm is implemented as a ROS node that subscribes to Arduino and receives the final ET error.This value represents the fitness of the current PID controller parameters.Then, the algorithm runs another cycle to calculate the updated PID parameters based on the received error.The Raspberry Pi publishes and sends the updated PID parameters to the Arduino.The cycle is repeated until the total error reaches the minimum value the proposed DHHO can reach.

PID Parameter Tuning Results
The PID parameters obtained by the DHHO algorithm are 14.1019, 86.4520, and 1.0117 for K p , K i , and K d , respectively.The performance of the proposed PID-DHHO controller is evaluated and compared with three other controllers tuned using the manual tuning technique, the Ziegler-Nichols (ZN) method, and the traditional HHO algorithm.
The obtained PID parameters using the traditional HHO algorithm are 33.1505,67.012, and 0.9064 for K p , K i , and K d , respectively.The PID gains obtained using the manual tuning method are K p = 5, K i = 30, and K d = 0.15 [70].Furthermore, the PID gains of the ZN method are 18, 31.92, and 2.45 for K p , K i , and K d , respectively, [71].The PID gains for all the methods are displayed in Table 9.After tuning, the system's performance is tested using four PID controllers: PID1 (manually tuned controller), PID2 (ZN method), PID3 (HHO algorithm), and PID4 (proposed DHHO algorithm).In total, five performance metrics were used to compare the quality of the transient response of the steering control process: the rise time (tr), the peak time (tp), the settling time (ts), the maximum overshoot (Mp), and the steady state error (ess).These metrics are essential to judge whether the system's response is accurate.

Performance Metrics
The rise time (tr) is the time required first to reach 90% of the desired value.This metric is significant as it measures how quickly the system generates the initial response to a change in steering input.Peak time (tp) is the time taken to reach the first peak of the steering angle.It is an indicator of the speed of the initial system response but is also associated with the oscillations.The settling time (ts) is the time required for the steering system to settle within a certain percentage of (2% or 5%) of the final steering angle.It indicates how quickly the system settles and stabilizes after input change [72].
The maximum overshoot (Mp) shows how much the response exceeded the desired steering angle, which is crucial for steering control as excessive overshoot can lead to instability and inaccurate steering angles [73].This metric is critical because it reflects the system's stability and ability to avoid over-correcting.A high overshoot can cause the steering angle to exceed the desired value, potentially leading to significant deviations from the planned path.This high value can be particularly problematic if the error accumulates over time, preventing the system from returning quickly to the correct steering angle.Minimizing overshoot is essential to avoid undesirable responses and ensure the vehicle remains on its intended path.
The steady-state error (ess) is the difference between the desired steering angle and the actual final one, which is essential for assessing the system's accuracy in reaching the desired steering angle.A low steady-state error ensures that the steering angle closely matches the desired angle, which is crucial for following a planned path accurately and reaching the destination [74].High accuracy is essential to avoid deviations from the intended path, which can lead to safety issues or failure to reach the destination.
The metrics ts, tr, and tp indicate the system's speed, while the ess and Mp indicate the system's accuracy.The control process represents a trade-off between accuracy and speed.In steering control and path planning for autonomous driving systems, reaching the destination safely and accurately is more important than quickly.Therefore, Mp and ess have more priority in the control process.

Experiment Setup and Data Collection
The transient response for each controller is measured and monitored for different steering angles, starting from −21°to 21 degrees.First, the steering angles are set to zero (center) at the beginning of each experiment at each steering angle trial.Second, the desired angle is set internally at the Arduino code for each controller at a specific steering angle.Third, the system starts, and the control system runs, in which the desired steering angle is compared to the current angle reading from the steering encoder sensor, generating the error signal.The PID controller generates the control signal to minimize this error to zero.
During the running, the steering angle is collected at different time steps starting from zero until the system terminates; we stop the system after 5 s from applying the desired angle, which is sufficient for all the systems to stabilize.The steering angle values and the corresponding time stamps are saved to be plotted and analyzed.The collected data has been stored and plotted using Matlab R2024a software as seen in Figure 9.The detailed collected readings for each controller's steering angle response at 20 timestamps for different steering angles are presented in the Supplementary Materials File (Table S1).

Results Analysis and Discussion
The collected results were analyzed using Matlab, and the performance metrics are calculated for each steering angle for each controller.The results show that all the PID controllers generate the same response regardless of the setpoint, showing the consistency and the reliability of the tuning obtained by all the algorithms, as seen in Figure 9. Table 10 shows the performance metrics for each controller.Regarding the steady-state error (ess), all the controllers managed to eliminate the steady-state error after five seconds from applying the desired angle, showing a zero-ess, as presented in Figure 10.The zero error behavior is due to the integral component of the PID controller, which is mutual in the four controllers used in the experiment.This merit is one of the main reasons why PID controllers, especially the Integral component, are viral in the control systems.
Figure 11a shows a close-up look at the rise time for all the PID controllers.The ZN and the HHO algorithms consistently provide the lower rise time, approximately 0.017 s, indicating faster response than the Manual and the proposed DHHO algorithms.However, the proposed DHHO algorithm also shows a competitive rise time of 0.022 s, which is too close to the ZN and HHO algorithms.Figure 11b shows all PID algorithms' peak time calculations.The HHO algorithm has the lowest peak time, 0.04 s, compared to the other algorithms.The proposed DHHO algorithm proved a peak time of 0.66 s, which seems too slow compared to the other three algorithms.However, this peak time is reached at the end of the response after the settling time because the DHHO algorithms' response has no oscillations.Therefore, slow peak time is not a disadvantage in this case.
The proposed DHHO algorithms stand out with a significant settling time of 0.0404 s, indicating rapid stabilization, as seen in Figure 11d.This metric is a crucial advantage as the system reaches stability quickly and accurately.The HHO algorithm shows a competitive setting time of 0.075 s, which is considered an acceptable response.Manual tuning offers a settling time of 0.378, better than that obtained from the ZN method of 0.785 s.
The proposed DHHO algorithm dominated the performance and outperformed all the algorithms with a zero maximum overshoot, as indicated in Figure 11c.The system's response is close to the overdamped response with no oscillations.This smooth response comes at the cost of a reduction in speed, as previously discussed.However, the fast stability with zero overshoot highlights the superiority of the proposed DHHO algorithm.

Overall Discussion
The main objective of this paper is to improve the steering performance of autonomous personal mobility scooters using a proposed algorithm named the differential Harris Hawks optimization (DHHO) algorithm.The findings of the theoretical and practical experiments conducted in this research can be formulated as follows:

The Theoretical Benchmark Testing of the DHHO Algorithm
The DHHO algorithm is proposed as an improved version of the original HHO algorithm.The objective of the DHHO algorithm is to improve the exploration and the global search of the HHO algorithm by deploying the DE/rand/1 mutation rule.The exploration of both algorithms has been validated on different dimensions, starting from 10D to 100D.The simulation results showed that the mean variance of the DHHO population is 6.0904303E+01, which is significantly greater than the variance of the HHO population (4.8669746E+01).The mean SD of the DHHO is 7.749476E+00, which is greater than the SD of HHO (6.952564E+00).Higher variance and SD in the population indicate better exploration capability of the DHHO algorithm and higher diversity compared with the original HHO algorithm.
The DHHO algorithm is validated on CEC2020/2021 benchmark functions and compared with the other algorithms used in the literature for steering control: the PSO, BAS, CMAES, and HHO algorithms.The DHHO algorithm ranked first on the Friedman test, and it showed a p-value less than 0.05 in all the paired comparisons with the PSO, BAS, CMAES, and HHO algorithms, indicating significant performance of the DHHO algorithm.

Mapping and Calibration of Steering Angle and the Encoder
The steering hardware of the personal mobility scooter is improved by introducing a potentiometer as a steering encoder mapped with the motor's shaft steering angle.A practical experiment has been conducted to find the relationship between the motor steering angle and encoder reading.Regression-supervised learning is performed on the collected results from the mapping experiment, and a fourth-degree polynomial is obtained with an F-statistic of 3.59E-25 and R-squared of 0.9983.
These results of this model mean that 99.83% of the variance in the steering angle can be explained by the encoder reading in the deduced equation.In other words, the regression model fits the data very well, with only 0.17% of the steering angle variance unexplained by the equation, avoiding an overfitting situation.This relationship is significant because the f-statistic is less than 0.05 (3.59e-25), indicating a reliable equation that can be used in the steering control application in the feedback control loop.

Application of the DHHO Algorithm on Steering Control
The DHHO algorithm is applied for the steering control for dynamic PID tuning, and it is compared with the traditional manual tuning, ZN method, and original HHO algorithm.The results of the four controllers showed exciting behavior in the four steering control systems regarding the rise time (tr), peak time (tp), settling time (ts), maximum overshoot (Mp), and steady-state error (ess).All the controllers managed to eliminate the ess due to the integral part of the PID controller.The transient response of the DHHO controller shows a slower initial response in terms of the tr (0.0224 s) and tp (0.66 s) compared with the other three controllers, where the ZN controller has a tr of 0.0162 s and a tp of 0.05 s.On the other hand, the DHHO algorithm eliminates Mp compared to the other three controllers.Moreover, DHHO has the smallest ts of 0.0404 s, while the ts for the manual, ZN, and HHO controllers are 0.3781 s, 0.7854 s, and 0.0745 s, respectively.
The interpretation of this phenomenon is that the slower the tr and tp, the more time the DHHO controller has to make precise decisions to avoid oscillations and overshoot such that it can settle at the goal in a faster settling time.Therefore, this slow initial response of the DHHO indicates a cautious response, which enables it to avoid oscillations and reduces the Mp and ts, which is a desirable accurate response.On the other hand, the other three controllers have a more rapid initial response with a small rise time and peak time.This quick initial response led to oscillations and high overshoot.Therefore, these systems take a longer settling time to stabilize and reach the stable case to overcome these oscillations, which explains the high settling time and overshoot.
The overall performance of the proposed DHHO algorithm managed to eliminate the overshoot and steady-state error with a smooth response free of oscillations, which is highly advantageous in providing a stable response.Although the rise and peak times are not the best compared to the other algorithms, they are still competitive and acceptable, especially after considering the remarkable performance of the other metrics (Mp and ts).Furthermore, the ts of the proposed scooter in [24] was around 0.580 s, larger than the one obtained by the DHHO controller (0.0404 s), showing significant improvement of the proposed methodology.

Conclusions
In this paper, we achieve improved steering control of the Ackermann mobility scooter using a PID controller optimized by a new algorithm named the Differential Harris Hawks Optimization (DHHO) algorithm.
First, a practical experiment was conducted on the power steering mechanism of the scooter to obtain the relationship between the steering motor angle and the steering encoder.Supervised learning and regression techniques were applied to help determine this relationship, which is a crucial equation in steering control.Statistical analysis was performed on these relationships to find the significance level and the reliability of the equations, and all achieved a p-value of less than 0.05.
The DHHO algorithm is proposed to improve the diversity of the original Harris Hawks Optimization (HHO) algorithm by introducing a Hawks mutation operator in the exploration phase instead of the Harris Hawks perch technique.This modification improved the diversity of the population compared to the HHO, decreasing the probability of becoming trapped into a local minimum.The mean variance of the DHHO population increased by 25.14%, and the mean SD increased by 11.74% compared with the HHO algorithm, indicating improved diversity in the DHHO population compared with the original HHO algorithm.
The DHHO algorithm is compared with the traditional HHO, PSO, BAS, and CMAES algorithms and validated on CEC2020/2021 benchmark functions.The proposed DHHO algorithm outperforms all the other algorithms, achieving first place in the Friedman test with significant p-values.In the 10-dimension case, the DHHO algorithm achieved better significant performance by 98.05%, 99.4141%, 99.8047%, and 99.8047% confidence compared with the PSO, CMAES, BAS, and HHO algorithms, respectively.Regarding the 20-dimension case, the DHHO algorithm achieved better significant performance by 99.0234%, 99.4141%, 99.8047%, and 91.6016% confidence compared with the PSO, CMAES, BAS, and HHO algorithms, respectively.These simulation results of the benchmark testing demonstrate that the DHHO algorithm outperformed the PSO, CMAES, BAS, and HHO algorithms.
The proposed DHHO algorithm is practically applied to the PID tuning of the steering control in the Ackermann scooter.The steering performance of the DHHO was evaluated compared with traditional PID, Ziegler-Nichols (ZN)-PID, and HHO-PID controllers.The

Figure 2 .
Diversity plots between HHO and DHHO exploration methods.(a) Mean diversity plots (variance and SD).(b) Dimensions size vs.Variance.

Figure 3 .
Violin plots for all the 10-Dim and 20-Dim CEC2020/2021 functions for all the algorithms in 30 runs.

Figure 4 .
Convergence plots for median error progress in 30 runs in all the CEC2020/2021 functions for the DHHO and the original HHO algorithms.

Figure 5 .
Figure 5. Overall hardware block diagram of the steering system of the scooter prototype.

Figure 7 .
Figure 7. Steering control block diagram as a closed-loop system.

Figure 8
Figure 8 displays the setup of the experiment and how the PID parameters are tuned in real time using the proposed DHHO algorithm.The setup is based on the communication between the Arduino and the Raspberry Pi.The Arduino is connected to the motor driver to send the control signal to the steering motor.A potentiometer is connected to the Arduino to read the current steering angle and send it to the Arduino through an analog signal.The Arduino is connected to the Raspberry Pi via a USB cable over the UART serial communication protocol.

Figure 8 .
Figure 8.The hardware setup of the PID tuning of the steering control.

Figure 10 .Figure 11 .
Figure 10.Transient response of the steering control using PID controller (Steady-state error for steering control).

Table 1 .
Variance comparison between the HHO and DHHO exploration techniques.

Table 2 .
Parameter Settings for the Algorithms.

Table 3 .
The error results for the 30 runs: best, worst, mean, median, std for the 10-Dim and 20-Dim CEC2020/2021 benchmark functions for all the algorithms.

Table 5 .
Measurements of the steering angle experiment.

Table 6 .
Polynomial Regression Analysis of Arduino Digital Reading and Motor Angle.

Table 7 .
Polynomial Regression Analysis of Motor Angle and Left Steering Angle.

Table 8 .
Polynomial Regression Analysis of Motor Angle and Right Steering Angle.

Table 9 .
PID parameters for each algorithm in steering control of the scooter.

Table 10 .
PID Tuning results and performance metrics in steering control.